package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author du
 *         date 2018/8/2 上午9:01
 */
public class VideoListResult implements Parcelable {
    /**
     * id : 422
     * title : 摸彩球
     * introduce : <p>本知识点介绍：</p><p>一、需掌握相关知识点：对可能性、可能性大小、可能的情况的认识，学会判断可能性的大小以及列举出可能发生的情况等。</p><p>二、本知识点共包括28道题目，具体为例题6道，随堂练习12道，自测卷10道。</p><p>三、建议学时为3小时（例题和随堂练习约2小时，自测卷为1小时）。</p>
     * video : [{"id":1505,"video_title":"知识点本源","posttime":1481299200,"is_learn":1}]
     * course_num : 7
     * examination : [{"id":319,"examination_title":"摸彩球测试卷"}]
     * study_num : 2065
     * video_describe : null
     * ucloud_video_url : http://video.niuwaketang.com/sxc_148134555427.mp4?k=23bca8e8d021bbf7&t=1512968626
     * ucloud_video_pic : http://video.niuwaketang.com/sxc_148134555427.jpg?k=8952847fde5e1ff9&t=1516164713
     * join_my_course : 1
     * message : [{"members_id":542,"content":"<p>孩子选的是2，因为题目写的是至少选到二等房，所以她没有考虑一等房。解析中说：至少选到二等房及以上。题目有必要改成\u201c选到二等房及以上\u201d吗？还是不用改，这就是考点？陷阱？<\/p>","posttime":1495196296,"answer_posttime":1495205493,"answer_content":"<p>亲爱的家长，您好！对于这道题目，我们是否可以这样来理解：按常理而言，第一名肯定会选一等房，第二、三名肯定会选二等房，所以题目考察的就是这个点，天天父子想至少选到二等房，也就是说他们第一名的话肯定会考虑一等房的意思，注意这里\u201c至少\u201d这个词的含义，其实就是\u201c二等房及以上\u201d这一意思。所以老师认为题目是没有问题的，不过为了更完善题干信息表达，老师对\u201c至少\u201d这一词做了更改，希望可以不产生误解。如果还有问题，希望您再留言给我。<\/p>","username":"晓卓","avatar":"http://api.niuwaketang.com/public/avatar/avatar.png"}]
     * exercises : [{"id":4266,"exercises_title":"<p>碗里有圆形糖果4个、方形糖果2颗、五角星糖果3颗，安安要用勺子舀一颗五角星糖果，每次舀一颗，请问最多要舀_______次就一定能够舀到？<\/p>","exercises_answer_type":3,"exercises_answer":[""],"correct_answer":["7"],"explain_ex":"<p>因为圆形糖果和方形糖果一共4+2=6颗，所以最多把所有圆形和方形糖果都舀完，就一定能舀到一个五角星糖果，即最多需要6+1=7次。<\/p>","exercises_answer_list":[""],"type_id":1,"is_good":1,"is_test":1}]
     */

    private String id;//课程id
    private String title;//课程名
    private String introduce;//课程介绍
    private String course_num;//课程数量
    private String study_num;//学习人数
    private String video_describe;//第一个视频描述
    private String ucloud_video_url;//第一个视频mp4地址
    private String ucloud_video_pic;//
    private String join_my_course;//是否加入了我的课程（1-未加入，2-已加入）
    private List<VideoEntity> video;//
    private List<ExaminationEntity> examination;//课程自测卷列表
    private List<MessageEntity> message;//课程留言列表
    private List<ExercisesEntity> exercises;//课程练习题列表

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public String getCourse_num() {
        return course_num;
    }

    public void setCourse_num(String course_num) {
        this.course_num = course_num;
    }

    public String getStudy_num() {
        return study_num;
    }

    public void setStudy_num(String study_num) {
        this.study_num = study_num;
    }

    public String getVideo_describe() {
        return video_describe;
    }

    public void setVideo_describe(String video_describe) {
        this.video_describe = video_describe;
    }

    public String getUcloud_video_url() {
        return ucloud_video_url;
    }

    public void setUcloud_video_url(String ucloud_video_url) {
        this.ucloud_video_url = ucloud_video_url;
    }

    public String getUcloud_video_pic() {
        return ucloud_video_pic;
    }

    public void setUcloud_video_pic(String ucloud_video_pic) {
        this.ucloud_video_pic = ucloud_video_pic;
    }

    public String getJoin_my_course() {
        return join_my_course;
    }

    public void setJoin_my_course(String join_my_course) {
        this.join_my_course = join_my_course;
    }

    public List<VideoEntity> getVideo() {
        return video;
    }

    public void setVideo(List<VideoEntity> video) {
        this.video = video;
    }

    public List<ExaminationEntity> getExamination() {
        return examination;
    }

    public void setExamination(List<ExaminationEntity> examination) {
        this.examination = examination;
    }

    public List<MessageEntity> getMessage() {
        return message;
    }

    public void setMessage(List<MessageEntity> message) {
        this.message = message;
    }

    public List<ExercisesEntity> getExercises() {
        return exercises;
    }

    public void setExercises(List<ExercisesEntity> exercises) {
        this.exercises = exercises;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.title);
        dest.writeString(this.introduce);
        dest.writeString(this.course_num);
        dest.writeString(this.study_num);
        dest.writeString(this.video_describe);
        dest.writeString(this.ucloud_video_url);
        dest.writeString(this.ucloud_video_pic);
        dest.writeString(this.join_my_course);
        dest.writeTypedList(this.video);
        dest.writeTypedList(this.examination);
        dest.writeTypedList(this.message);
        dest.writeTypedList(this.exercises);
    }

    public VideoListResult() {
    }

    protected VideoListResult(Parcel in) {
        this.id = in.readString();
        this.title = in.readString();
        this.introduce = in.readString();
        this.course_num = in.readString();
        this.study_num = in.readString();
        this.video_describe = in.readString();
        this.ucloud_video_url = in.readString();
        this.ucloud_video_pic = in.readString();
        this.join_my_course = in.readString();
        this.video = in.createTypedArrayList(VideoEntity.CREATOR);
        this.examination = in.createTypedArrayList(ExaminationEntity.CREATOR);
        this.message = in.createTypedArrayList(MessageEntity.CREATOR);
        this.exercises = in.createTypedArrayList(ExercisesEntity.CREATOR);
    }

    public static final Creator<VideoListResult> CREATOR = new Creator<VideoListResult>() {
        @Override
        public VideoListResult createFromParcel(Parcel source) {
            return new VideoListResult(source);
        }

        @Override
        public VideoListResult[] newArray(int size) {
            return new VideoListResult[size];
        }
    };

    public static class VideoEntity implements Parcelable {
        /**
         * id : 1505
         * video_title : 知识点本源
         * posttime : 1481299200
         * is_learn : 1
         */

        private String id;//课程视频id
        private String video_title;//课程视频标题
        private String posttime;//课程视频添加时间戳
        private String is_learn;//是否已学习（1-未学习，2-已学习）

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getVideo_title() {
            return video_title;
        }

        public void setVideo_title(String video_title) {
            this.video_title = video_title;
        }

        public String getPosttime() {
            return posttime;
        }

        public void setPosttime(String posttime) {
            this.posttime = posttime;
        }

        public String getIs_learn() {
            return is_learn;
        }

        public void setIs_learn(String is_learn) {
            this.is_learn = is_learn;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.video_title);
            dest.writeString(this.posttime);
            dest.writeString(this.is_learn);
        }

        public VideoEntity() {
        }

        protected VideoEntity(Parcel in) {
            this.id = in.readString();
            this.video_title = in.readString();
            this.posttime = in.readString();
            this.is_learn = in.readString();
        }

        public static final Creator<VideoEntity> CREATOR = new Creator<VideoEntity>() {
            @Override
            public VideoEntity createFromParcel(Parcel source) {
                return new VideoEntity(source);
            }

            @Override
            public VideoEntity[] newArray(int size) {
                return new VideoEntity[size];
            }
        };
    }

    public static class ExaminationEntity implements Parcelable {
        /**
         * id : 319
         * examination_title : 摸彩球测试卷
         */

        private String id;//自测卷id
        private String examination_title;//自测卷标题

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getExamination_title() {
            return examination_title;
        }

        public void setExamination_title(String examination_title) {
            this.examination_title = examination_title;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.examination_title);
        }

        public ExaminationEntity() {
        }

        protected ExaminationEntity(Parcel in) {
            this.id = in.readString();
            this.examination_title = in.readString();
        }

        public static final Creator<ExaminationEntity> CREATOR = new Creator<ExaminationEntity>() {
            @Override
            public ExaminationEntity createFromParcel(Parcel source) {
                return new ExaminationEntity(source);
            }

            @Override
            public ExaminationEntity[] newArray(int size) {
                return new ExaminationEntity[size];
            }
        };
    }

    public static class ExercisesEntity implements Parcelable {
        /**
         * id : 4266
         * exercises_title : <p>碗里有圆形糖果4个、方形糖果2颗、五角星糖果3颗，安安要用勺子舀一颗五角星糖果，每次舀一颗，请问最多要舀_______次就一定能够舀到？</p>
         * exercises_answer_type : 3
         * exercises_answer : [""]
         * correct_answer : ["7"]
         * explain_ex : <p>因为圆形糖果和方形糖果一共4+2=6颗，所以最多把所有圆形和方形糖果都舀完，就一定能舀到一个五角星糖果，即最多需要6+1=7次。</p>
         * exercises_answer_list : [""]
         * type_id : 1
         * is_good : 1
         * is_test : 1
         */

        private String id;//练习题id
        private String exercises_title;//练习题问题
        private String exercises_answer_type;//练习题类型（1-单选，2-多选，3-填空）
        private String explain_ex;//解析
        private String type_id;//好题本类型id（用于提供加入好题本type_id）
        private String is_good;//是否加入好题本(1-未加入，2-已加入)
        private String is_test;//是否做过(1-未做过，2-已做过)
        private List<String> exercises_answer;//答案
        private List<String> correct_answer;//正确答案（如果是选择题3表示c）
        private List<String> exercises_answer_list;//答案列表
        private boolean isWrite;
        private String value = "";

        public boolean isWrite() {
            return isWrite;
        }

        public void setWrite(boolean write) {
            isWrite = write;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getExercises_title() {
            return exercises_title;
        }

        public void setExercises_title(String exercises_title) {
            this.exercises_title = exercises_title;
        }

        public String getExercises_answer_type() {
            return exercises_answer_type;
        }

        public void setExercises_answer_type(String exercises_answer_type) {
            this.exercises_answer_type = exercises_answer_type;
        }

        public String getExplain_ex() {
            return explain_ex;
        }

        public void setExplain_ex(String explain_ex) {
            this.explain_ex = explain_ex;
        }

        public String getType_id() {
            return type_id;
        }

        public void setType_id(String type_id) {
            this.type_id = type_id;
        }

        public String getIs_good() {
            return is_good;
        }

        public void setIs_good(String is_good) {
            this.is_good = is_good;
        }

        public String getIs_test() {
            return is_test;
        }

        public void setIs_test(String is_test) {
            this.is_test = is_test;
        }

        public List<String> getExercises_answer() {
            return exercises_answer;
        }

        public void setExercises_answer(List<String> exercises_answer) {
            this.exercises_answer = exercises_answer;
        }

        public List<String> getCorrect_answer() {
            return correct_answer;
        }

        public void setCorrect_answer(List<String> correct_answer) {
            this.correct_answer = correct_answer;
        }

        public List<String> getExercises_answer_list() {
            return exercises_answer_list;
        }

        public void setExercises_answer_list(List<String> exercises_answer_list) {
            this.exercises_answer_list = exercises_answer_list;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.exercises_title);
            dest.writeString(this.exercises_answer_type);
            dest.writeString(this.explain_ex);
            dest.writeString(this.type_id);
            dest.writeString(this.is_good);
            dest.writeString(this.is_test);
            dest.writeStringList(this.exercises_answer);
            dest.writeStringList(this.correct_answer);
            dest.writeStringList(this.exercises_answer_list);
        }

        public ExercisesEntity() {
        }

        protected ExercisesEntity(Parcel in) {
            this.id = in.readString();
            this.exercises_title = in.readString();
            this.exercises_answer_type = in.readString();
            this.explain_ex = in.readString();
            this.type_id = in.readString();
            this.is_good = in.readString();
            this.is_test = in.readString();
            this.exercises_answer = in.createStringArrayList();
            this.correct_answer = in.createStringArrayList();
            this.exercises_answer_list = in.createStringArrayList();
        }

        public static final Creator<ExercisesEntity> CREATOR = new Creator<ExercisesEntity>() {
            @Override
            public ExercisesEntity createFromParcel(Parcel source) {
                return new ExercisesEntity(source);
            }

            @Override
            public ExercisesEntity[] newArray(int size) {
                return new ExercisesEntity[size];
            }
        };
    }

}
